import {AuthService} from "../service/auth/auth.service";
import {AuthInfo} from "../entity/auth.entity";
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from "@angular/router";
import {Injectable} from "@angular/core";
import {Observable} from "rxjs/index";

@Injectable()
export class NavResolve implements Resolve<AuthInfo>{


  constructor(private authService: AuthService){

  }

  resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<AuthInfo> | Promise<AuthInfo> | AuthInfo {
    return this.authService.getAuthInfo();
  }

}
